package com.john.factory.method;

public class AnimalTest {
	
	public static void main(String[] args) {
		AnimalFactory af = new DogFactory();
		Animal a = af.createAnimal();
		a.eat();	
		
		af = new CatFactory();
		a = af.createAnimal();
		a.eat();
		
		af = new PigFactory();
		a = af.createAnimal();
		a.eat();
	}
}
